#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
class Solution {
public:
    vector<int> drawLine(int length, int w, int x1, int x2, int y) {
        vector<int>vec(length);
        int start = y * w / 32;
        int end = (y + 1) * w / 32;
        if (x2 < x1) swap(x1, x2);
        for (int index = 0; index < end - start; ++index) {
            int left = 32 * index;
            int right = 32 * (index + 1);
            if (x1 >= right) continue;
            if (x2 < left) break;
            int len = min(x2 + 1, right) - max(x1, left);
            if (len >= 32) vec[start + index] -= 1;
            else vec[start + index] = ((1 << len) - 1) << (right - min(x2 + 1, right));
        }
        return vec;
    }
};

int main() {
    Solution sol;
    sol.drawLine(3, 96, 0, 95, 0);
}